home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / e_to_l / itgraph / vb30 / orgchart / orgchart.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-15  |  10.0 KB  |  328 lines

  1. VERSION 2.00
  2. Begin Form frmOrgChart 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "ORGCHARTER"
  5.    ClientHeight    =   6216
  6.    ClientLeft      =   888
  7.    ClientTop       =   1980
  8.    ClientWidth     =   9384
  9.    ForeColor       =   &H00FFFFFF&
  10.    Height          =   6864
  11.    Icon            =   ORGCHART.FRX:0000
  12.    Left            =   840
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6216
  17.    ScaleWidth      =   9384
  18.    Top             =   1380
  19.    Width           =   9480
  20.    Begin ITGraph itgOrgChart 
  21.       ArrangeMode     =   3  'Tree
  22.       AutoArrange     =   0  'Manual Arrange
  23.       AutoMouseEvents =   ORGCHART.FRX:0302
  24.       BackColor       =   &H00FFFFFF&
  25.       DragItems       =   0   'False
  26.       DrawArrows      =   0   'False
  27.       DrawBackLinks   =   1  'ITG_SolidBackLinks
  28.       DrawColored     =   -1  'True
  29.       DrawConnLabels  =   -1  'True
  30.       DrawDir         =   3  'Top To Bottom
  31.       DrawHandles     =   -1  'True
  32.       DrawItemLabels  =   -1  'True
  33.       DrawScale       =   100
  34.       FillColor       =   &H00FFFFFF&
  35.       ForeColor       =   &H00000000&
  36.       Gap             =   10
  37.       GraphicAllowImport=   0  'No Import
  38.       Graphics        =   ORGCHART.FRX:0332
  39.       Height          =   1776
  40.       Left            =   1872
  41.       LineWidth       =   0
  42.       PrintHeader     =   ""
  43.       PrintRectHeight =   -1
  44.       PrintRectLeft   =   -1
  45.       PrintRectTop    =   -1
  46.       PrintRectWidth  =   -1
  47.       Redraw          =   -1  'True
  48.       RubberBand      =   1  'RB For Items
  49.       SelectedIndex   =   -1
  50.       SelectRectEnabled=   0   'False
  51.       SelectRectHeight=   0
  52.       SelectRectLeft  =   0
  53.       SelectRectTop   =   0
  54.       SelectRectWidth =   0
  55.       StoreGraphics   =   2  'Save Referenced Graphics
  56.       TabIndex        =   0
  57.       Top             =   972
  58.       Width           =   2388
  59.       XSpace          =   20
  60.       XSpan           =   120
  61.       YSpace          =   0
  62.       YSpan           =   50
  63.    End
  64.    Begin Menu File 
  65.       Caption         =   "&File"
  66.       Begin Menu File_Clear 
  67.          Caption         =   "&Clear"
  68.       End
  69.       Begin Menu File_Print 
  70.          Caption         =   "&Print"
  71.       End
  72.       Begin Menu bar 
  73.          Caption         =   "-"
  74.       End
  75.       Begin Menu File_Exit 
  76.          Caption         =   "E&xit"
  77.       End
  78.    End
  79.    Begin Menu Edit 
  80.       Caption         =   "&Edit"
  81.       Begin Menu Edit_AddNew 
  82.          Caption         =   "&Add New"
  83.       End
  84.       Begin Menu Edit_Delete 
  85.          Caption         =   "&Delete"
  86.       End
  87.       Begin Menu Edit_bar 
  88.          Caption         =   "-"
  89.       End
  90.       Begin Menu Edit_ClearText 
  91.          Caption         =   "&Clear Text"
  92.       End
  93.    End
  94.    Begin Menu Appearance 
  95.       Caption         =   "A&ppearance"
  96.       Begin Menu MouseDrag 
  97.          Caption         =   "&Mouse Drag"
  98.          Begin Menu App_Mouse_Connect 
  99.             Caption         =   "&Connect Nodes"
  100.          End
  101.          Begin Menu App_Mouse_MoveNodes 
  102.             Caption         =   "&Move Nodes"
  103.          End
  104.       End
  105.       Begin Menu ScreenSize 
  106.          Caption         =   "&Screen Size"
  107.          Begin Menu App_ScrSize_Standard 
  108.             Caption         =   "S&tandard (VGA)"
  109.          End
  110.          Begin Menu App_ScrSize_FitToScreen 
  111.             Caption         =   "&Fit To Screen"
  112.          End
  113.       End
  114.       Begin Menu NodeSize 
  115.          Caption         =   "Node Si&ze"
  116.          Begin Menu App_Size_Large 
  117.             Caption         =   "&Large (250 x 100)"
  118.          End
  119.          Begin Menu App_Size_Medium 
  120.             Caption         =   "&Medium (200 x 75)"
  121.          End
  122.          Begin Menu App_Size_Small 
  123.             Caption         =   "&Small (150 x 50)"
  124.          End
  125.       End
  126.       Begin Menu Arrange_Scale 
  127.          Caption         =   "&Scale..."
  128.          Begin Menu Arrange_Scale_100 
  129.             Caption         =   "100%"
  130.          End
  131.          Begin Menu Arrange_Scale_Fit 
  132.             Caption         =   "Fit To Screen"
  133.          End
  134.       End
  135.    End
  136.    Begin Menu Arrange 
  137.       Caption         =   "&Arrange"
  138.       Begin Menu Arrange_Now 
  139.          Caption         =   "&Now"
  140.       End
  141.       Begin Menu Arrange_OnNewConn 
  142.          Caption         =   "&On New Connection"
  143.       End
  144.    End
  145. Dim i_selnodeix As Integer
  146. Sub AllWhite ()
  147.   Dim i%
  148.   For i = 0 To itgOrgChart.ListCount
  149.     itgOrgChart.ItemFillColor(i) = WHITE
  150.     Edit_Delete.Enabled = False
  151.     Edit_ClearText.Enabled = False
  152.   Next i
  153. End Sub
  154. Sub App_Mouse_Connect_Click ()
  155.   itgOrgChart.DragItems = False
  156.   App_Mouse_Connect.Checked = True
  157.   App_Mouse_MoveNodes.Checked = False
  158. End Sub
  159. Sub App_Mouse_MoveNodes_Click ()
  160.   itgOrgChart.DragItems = True
  161.   App_Mouse_Connect.Checked = False
  162.   App_Mouse_MoveNodes.Checked = True
  163. End Sub
  164. Sub App_ScrSize_FitToScreen_Click ()
  165.  Me.Width = Screen.Width
  166.  Me.Height = Screen.Height
  167.  Call CenterForm(Me)
  168.  Call DrawChart(Me)
  169.  App_ScrSize_Standard.Checked = False
  170.  App_ScrSize_FitToScreen.Checked = True
  171. End Sub
  172. Sub App_ScrSize_Standard_Click ()
  173.   Me.Width = 640 * Screen.TwipsPerPixelX
  174.   Me.Height = 480 * Screen.TwipsPerPixelY
  175.   Call CenterForm(Me)
  176.   Call DrawChart(Me)
  177.   App_ScrSize_Standard.Checked = True
  178.   App_ScrSize_FitToScreen.Checked = False
  179. End Sub
  180. Sub App_Size_Large_Click ()
  181.   itgOrgChart.XSpan = 250
  182.   itgOrgChart.YSpan = 100
  183.   itgOrgChart.AutoArrange = ITG_ArrangeNow
  184.   App_Size_Large.Checked = True
  185.   App_Size_Medium.Checked = False
  186.   App_Size_Small.Checked = False
  187. End Sub
  188. Sub App_Size_Medium_Click ()
  189.   itgOrgChart.XSpan = 200
  190.   itgOrgChart.YSpan = 75
  191.   itgOrgChart.AutoArrange = ITG_ArrangeNow
  192.   App_Size_Large.Checked = False
  193.   App_Size_Medium.Checked = True
  194.   App_Size_Small.Checked = False
  195. End Sub
  196. Sub App_Size_Small_Click ()
  197.   itgOrgChart.XSpan = 150
  198.   itgOrgChart.YSpan = 50
  199.   itgOrgChart.AutoArrange = ITG_ArrangeNow
  200.   App_Size_Large.Checked = False
  201.   App_Size_Medium.Checked = False
  202.   App_Size_Small.Checked = True
  203. End Sub
  204. Sub Arrange_Now_Click ()
  205.   If Arrange_OnNewConn.Checked = True Then
  206.     itgOrgChart.AutoArrange = ITG_AutoArrange
  207.   Else
  208.     itgOrgChart.AutoArrange = ITG_ArrangeNow
  209.   End If
  210. End Sub
  211. Sub Arrange_OnNewConn_Click ()
  212.   Arrange_OnNewConn.Checked = Not Arrange_OnNewConn.Checked
  213.   If Arrange_OnNewConn.Checked = True Then
  214.     itgOrgChart.AutoArrange = ITG_AutoArrange
  215.   Else
  216.     itgOrgChart.AutoArrange = ITG_ManualArrange
  217.   End If
  218. End Sub
  219. Sub Arrange_Scale_100_Click ()
  220.   itgOrgChart.DrawScale = 100
  221.   Arrange_Scale_100.Checked = True
  222.   Arrange_Scale_Fit.Checked = False
  223. End Sub
  224. Sub Arrange_Scale_Fit_Click ()
  225.   itgOrgChart.DrawScale = 0
  226.   Arrange_Scale_100.Checked = False
  227.   Arrange_Scale_Fit.Checked = True
  228. End Sub
  229. Sub Edit_AddNew_Click ()
  230.   i_selnodeix = -1
  231.   MousePointer = 2
  232.   Edit_Delete.Enabled = False
  233.   Call AllWhite
  234. End Sub
  235. Sub Edit_ClearText_Click ()
  236.   itgOrgChart.List(i_selnodeix) = ""
  237. End Sub
  238. Sub Edit_Delete_Click ()
  239.   If Not i_selnodeix Then
  240.     itgOrgChart.RemoveItem i_selnodeix
  241.     i_NODECNT = i_NODECNT - 1
  242.     If i_NODECNT = 0 Then
  243.       Call File_Clear_Click
  244.     End If
  245.     Edit_Delete.Enabled = False
  246.     Call AllWhite
  247.   End If
  248. End Sub
  249. Sub File_Clear_Click ()
  250.   itgOrgChart.Clear
  251.   File_Print.Enabled = False
  252. End Sub
  253. Sub File_Exit_Click ()
  254.   Call ShutDown
  255. End Sub
  256. Sub File_Print_Click ()
  257.   itgOrgChart.PrintGraph = 0
  258. End Sub
  259. Sub Form_Activate ()
  260.   i_selnodeix = -1
  261.   Call Arrange_Scale_100_Click
  262. End Sub
  263. Sub Form_Resize ()
  264.   Call DrawChart(Me)
  265.   Call Arrange_Scale_Fit_Click
  266. End Sub
  267. Sub itgOrgChart_Click (Button As Integer, Shift As Integer, X As Integer, Y As Integer)
  268.   Dim nindx%
  269.   If MousePointer = 2 Then
  270.     itgOrgChart.AddItem "<NEW NODE>"
  271.     nindx = itgOrgChart.NewIndex
  272.     itgOrgChart.ItemFillColor(nindx) = LTBLUE
  273.     itgOrgChart.ItemXpos(nindx) = X
  274.     itgOrgChart.ItemYpos(nindx) = Y
  275.     MousePointer = 0
  276.     i_selnodeix = nindx
  277.     i_NODECNT = i_NODECNT + 1
  278.     File_Print.Enabled = True
  279.     Edit_Delete.Enabled = True
  280.     Edit_ClearText.Enabled = True
  281.   Else
  282.     Call AllWhite
  283.   End If
  284. End Sub
  285. Sub itgOrgChart_ItemClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
  286.   Call AllWhite
  287.   itgOrgChart.ItemFillColor(ItemIx) = LTBLUE
  288.   i_selnodeix = ItemIx
  289.   Edit_Delete.Enabled = True
  290.   Edit_ClearText.Enabled = True
  291. End Sub
  292. Sub itgOrgChart_ItemConnect (FromIx As Integer, FromHandle As Integer, ToIx As Integer, ToHandle As Integer, Button As Integer, Shift As Integer)
  293.   itgOrgChart.ConnectTo(FromIx) = ToIx
  294. End Sub
  295. Sub itgOrgChart_ItemDblClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
  296.   Dim msg$, Cap$
  297.   msg = "There "
  298.   If itgOrgChart.ListCount < 2 Then
  299.     msg = msg & " is currently 1 node"
  300.   Else
  301.     msg = msg & "are currently " & CStr(itgOrgChart.ListCount) & " nodes "
  302.   End If
  303.   msg = msg & " in the organization chart.  "
  304.   msg = msg & "The item index property (""ItemIx"") of the selected item is: "
  305.   msg = msg & CStr(ItemIx)
  306.   Cap = "INFO FOR SELECTED NODE"
  307.   MsgBox msg, 64, Cap
  308. End Sub
  309. Sub itgOrgChart_KeyPress (KeyAscii As Integer)
  310.   Dim temp$
  311.   If itgOrgChart.List(i_selnodeix) = "<NEW NODE>" Then
  312.     itgOrgChart.List(i_selnodeix) = ""
  313.   End If
  314.   If KeyAscii = 8 Then
  315.     If Len(itgOrgChart.List(i_selnodeix)) > 0 Then
  316.       itgOrgChart.List(i_selnodeix) = Left(itgOrgChart.List(i_selnodeix), Len(itgOrgChart.List(i_selnodeix)) - 1)
  317.     End If
  318.   Else
  319.     itgOrgChart.List(i_selnodeix) = itgOrgChart.List(i_selnodeix) & Chr$(KeyAscii)
  320.   End If
  321. End Sub
  322. Sub itgOrgChart_LineDblClick (FromIx As Integer, ToIx As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
  323.   itgOrgChart.RemoveFrom(FromIx) = ToIx
  324. End Sub
  325. Sub ShutDown ()
  326.   End
  327. End Sub
  328.